//
//  AliyunCredentialModel.swift
//  XiaoweHealthy
//
//  Created by Riven on 2022/7/14.
//

import HandyJSON

/// 阿里云oss Credential 参数模型
struct AliyunCredentialModel: HandyJSON, CustomStringConvertible {
    
    var keyId: String = ""
    var keySecret: String = ""
    var securityToken: String = ""
    var expirationTimeInGMTFormat: String = ""
    // AliyunUploadManager.kFileBaseUrl
    var endPoint: String = ""
    
    // AliyunUploadManager.kBucketName
    var bucketName: String = ""
    var bucketUrl: String = ""
    var resourceDir = ""
    
    var description: String {
        "{ keyId = \(keyId), keySecret = \(keySecret), securityToken = \(securityToken), expirationTimeInGMTFormat = \(expirationTimeInGMTFormat), endPoint = \(endPoint), bucketName = \(bucketName), bucketUrl = \(bucketUrl), resourceDir = \(resourceDir) }"
    }
    
    // MARK: - HandyJSON
    mutating func mapping(mapper: HelpingMapper) {
        mapper <<<
            keyId <-- "accessKeyId"
        
        mapper <<<
            keySecret <-- "accessKeySecret"

        mapper <<<
            securityToken <-- "securityToken"
        
        mapper <<<
            expirationTimeInGMTFormat <-- "expired"
    }
    
}
